﻿<div class="row">
    <div class="col-xs-12 col-md-12 col-lg-12">
        <div class="widget">
            <div class="widget-header bg-blue">
            	<i class="widget-icon fa fa-arrow-left"></i>
                <span class="widget-caption">分组管理</span>
                <div class="widget-buttons">
                    <a href="#" data-toggle="maximize">
                        <i class="fa fa-expand"></i>
                    </a>
                    <a href="#" data-toggle="collapse">
                        <i class="fa fa-minus"></i>
                    </a>
                    <a href="#" data-toggle="dispose">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="widget-body" style="height: auto;">
            	
            	<table class="table table-hover table-striped table-bordered">
                    <thead class="bordered-blueberry">
                        <tr role="row">
                        	<th style="width: 80px;">分组id</th>
                        	<th>分组名称</th>
                        	<th>分组中人数</th>
                        	<th style="width: 155px;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<volist name="cache" id="vo">
                    		<tr>
                    			<td>{$vo.id}</td>
                    			<td>{$vo.name}</td>
                    			<td>{$vo.count}</td>
                    			<td align="center">
                        			<a href="{:U('Admin/Wx/group_set',array('id'=>$vo['id']))}" data-loader="bb-loader" data-loadername="修改分组" class="btn btn-info btn-xs edit"><i class="fa fa-edit"></i> 修改</a>
                        			<a href="#" id="del" data-id="{$vo.id}" class="btn btn-danger btn-xs delete"><i class="fa fa-trash-o"></i> 删除</a>
                        		</td>
                    		</tr>
                    	</volist>
                    </tbody>
                </table>
               <div class="row DTTTFooter">{$page}</div>
            </div>
         </div>
    </div>
</div>
         
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>

<script type="text/javascript">
//删除数据库中的菜单
	$('.delete').on('click',function(){
		var id=$(this).data('id');
		var tourl="{:U('Admin/Wx/group_del')}";
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				$('#refresh-toggler').trigger('click');
				return false;
			};
			$.bb.ajax('post',tourl,{'id':id},callok,callerr);
		}						
		$.bb.confirm("确认要删除数据库的菜单吗？",funok);
	});
</script>